package cn.iocoder.yudao.module.erp.dal.mysql.warehouseoutlist;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouseoutlist.WarehouseOutListDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.warehouseoutlist.vo.*;

/**
 * ERP 出库单表（一二级库） Mapper
 *
 * @author songkai
 */
@Mapper
public interface WarehouseOutListMapper extends BaseMapperX<WarehouseOutListDO> {

    default PageResult<WarehouseOutListDO> selectPage(WarehouseOutListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseOutListDO>()
                .eqIfPresent(WarehouseOutListDO::getOutId, reqVO.getOutId())
                .eqIfPresent(WarehouseOutListDO::getOutDeptId, reqVO.getOutDeptId())
                .eqIfPresent(WarehouseOutListDO::getInDeptId, reqVO.getInDeptId())
                .betweenIfPresent(WarehouseOutListDO::getOutTime, reqVO.getOutTime())
                .eqIfPresent(WarehouseOutListDO::getStatus, reqVO.getStatus())
                .eqIfPresent(WarehouseOutListDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(WarehouseOutListDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WarehouseOutListDO::getId));
    }

}